package info.rongtong.action;

import java.io.File;

import info.rongtong.domain.FileUpload;
import info.rongtong.domain.Picture;
import info.rongtong.service.inter.CategoryServiceInter;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

public class PicAction extends ActionSupport {

	private static final long serialVersionUID = 1L;
	private HttpServletRequest request = ServletActionContext.getRequest();
	private CategoryServiceInter categoryServiceImpl;
	private FileUpload picFile;
	private Picture pic;
	public String goPicManageUi(){
		//准备类别信息
		request.setAttribute("categoryList", categoryServiceImpl.getCategoryByType(1)) ;
		return "Ui";
	}
	
	public String goAddPicUi(){
		request.setAttribute("categoryList", categoryServiceImpl.getCategoryByType(1)) ;
		return "goAddUi";
	}
	
	public String savePic(){
		
		request.setAttribute("categoryList", categoryServiceImpl.getCategoryByType(1)) ;
		return "Ui";
	}


	
	// get 与 set 方法
	public CategoryServiceInter getCategoryServiceImpl() {
		return categoryServiceImpl;
	}

	public void setCategoryServiceImpl(CategoryServiceInter categoryServiceImpl) {
		this.categoryServiceImpl = categoryServiceImpl;
	}

	public FileUpload getPicFile() {
		return picFile;
	}

	public void setPicFile(FileUpload picFile) {
		this.picFile = picFile;
	}

	public Picture getPic() {
		return pic;
	}

	public void setPic(Picture pic) {
		this.pic = pic;
	}
	
}
